home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / html / vendors / siteways / software / bin / nsservers.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1997-07-16  |  652b  |  32 lines

  1. #!/bin/sh
  2. #
  3. # $Header: /ext/src/lss/src/scripts/RCS/nsservers.sh,v 1.6 1997/03/13 16:27:49 bert Exp $
  4. #
  5. CDROM="$1"
  6.  
  7. #
  8. # extract next parameter directly following -d
  9. #
  10. DIRS=`ps -ef | fgrep "httpd " | fgrep -v fgrep | while read line
  11. do
  12.    echo "$line" | sed 's/.*-d //' | awk '{print $1;}'
  13. done | sort -u`
  14.  
  15. #
  16. # check DIRS, for configuration files
  17. #
  18. for dir in $DIRS
  19. do
  20.    config_file=$dir/magnus.conf
  21.  
  22.    if [ -f $config_file ]
  23.    then
  24.       ADDRESS=`fgrep -i Address $config_file | awk '{print $2}'`
  25.       SERVERNAME="`$CDROM/bin/lookup $ADDRESS`"
  26.       if [ ! -z "$SERVERNAME" ]
  27.       then
  28.          echo "$config_file:$SERVERNAME"
  29.       fi
  30.    fi
  31. done
  32.